package com.example.rdemo.service;

import java.util.List;

import com.example.rdemo.entity.Goods;
import com.example.rdemo.entity.Shop;
import com.example.rdemo.mapper.GoodsMapper;
import com.example.rdemo.utils.PageResult;
import com.example.rdemo.utils.PageUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * goodsService业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-03
 */
@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

    //查询goods
    @Override
    public Goods selectGoodsByGid(Long gid)
    {
        return goodsMapper.selectGoodsByGid(gid);
    }
    //cid查询
    @Override
    public Goods selectByCid(Long cid) {
        return goodsMapper.selectByCid(cid);
    }

    //查询goods列表
    @Override
    public List<Goods> selectGoodsList(Goods goods) {
        List<Goods> list = goodsMapper.selectGoodsList(goods);
        return list;
    }


    //新增goods
    @Override
    public int insertGoods(Goods goods)
    {
        return goodsMapper.insertGoods(goods);
    }

    //修改goods
    @Override
    public int updateGoods(Goods goods)
    {
        return goodsMapper.updateGoods(goods);
    }

    //批量删除goods
    @Override
    public int deleteGoodsByGids(Long[] gids)
    {
        return goodsMapper.deleteGoodsByGids(gids);
    }

    //删除goods信息
    @Override
    public int deleteGoodsByGid(Long gid)
    {
        return goodsMapper.deleteGoodsByGid(gid);
    }
}
